package com.example.coding_problem.Fragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import org.jetbrains.annotations.Nullable;

import java.util.List;

class ViewPagerAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragmentList;
    private String[] stringsTools;
    public ViewPagerAdapter(FragmentManager fm, List<Fragment> fragmentList, String[] stringsTools) {
        super(fm);
        this.fragmentList=fragmentList;
        this.stringsTools=stringsTools;
    }

    public ViewPagerAdapter(FragmentManager childFragmentManager) {
        super(childFragmentManager);
    }

    @Override
    public Fragment getItem(int i) {
        return fragmentList.get(i);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }
    @Nullable
    @Override
    public CharSequence getPageTitle(int position){
        return stringsTools[position];
    }
}
